package com.magold.event;

import java.util.LinkedList;
import java.util.List;

import org.andengine.engine.handler.IUpdateHandler;

public class EventsProcessor implements IUpdateHandler {
	private List<Event> mEvents;
	
	public EventsProcessor() {
		mEvents = new LinkedList<Event>();
	}
	
	public void registerEvents(Event pEvent) {
		mEvents.add(pEvent);
	}
	
	@Override
	public void onUpdate(float pSecondsElapsed) {
		for (Event e : mEvents) {
			e.onUpdate(pSecondsElapsed);
		}
	}

	@Override
	public void reset() {
		for (Event e : mEvents) {
			e.reset();
		}
	}

}
